package com.example.androidpattern.decorator;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;

import com.example.androidpattern.R;
import com.example.androidpattern.decorator.classes.Circle;
import com.example.androidpattern.decorator.classes.RJMEggs;
import com.example.androidpattern.decorator.classes.RJMHot;
import com.example.androidpattern.decorator.classes.RouJiaMo;
import com.example.androidpattern.decorator.classes.ShapeColor;
import com.example.androidpattern.decorator.classes.ShapeSize;

public class DecoratorActivity extends AppCompatActivity {
    private static final String TAG = "DecoratorActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_decorator);

        shapeTest();
        roujiamoTest();
    }

    private void roujiamoTest() {
        RJMHot rouJiaMo = new RJMHot(new RJMEggs(new RouJiaMo(), 8), 22);
        Log.d(TAG, "roujiamoTest: " + rouJiaMo.info());
        Log.d(TAG, "roujiamoTest: " + rouJiaMo.price());
    }

    private void shapeTest() {
        ShapeSize shape = new ShapeSize(new ShapeColor(new Circle(), "红色"), 100);
        shape.display();

    }
}